<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>综合产品中心项目日报管理系统</title>
    
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script type="text/javascript" src="${pageContext.request.contextPath}/plugs/login/js/jquery-1.9.0.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/plugs/login/images/login.js"></script>
	<link href="${pageContext.request.contextPath}/plugs/login/css/login2.css" rel="stylesheet" type="text/css" />
	<!--impromptu控件开始{-->
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/plugs/impromptu/themes/tap/style/style.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/plugs/impromptu/jquery-impromptu.min.js"></script>
	<!--}impromptu控件结束-->
	<link href="${pageContext.request.contextPath}/plugs/formvalidator/style/validator.css" rel="stylesheet" type="text/css" /><!--表单验证样式表--> 
	<script	src="${pageContext.request.contextPath}/plugs/formvalidator/formValidator_min.js" type="text/javascript" charset="UTF-8"></script>
	<script	src="${pageContext.request.contextPath}/plugs/formvalidator/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
	
	<script type="text/javascript">
$(document).ready(function() {
	$.formValidator.initConfig({
		formID : "regUserForm",
		onError : function() {
			alert("校验没有通过，具体错误请看错误提示");
		},
	});
	$("#registusername").formValidator({onshow:"请输入用户名",onfocus:"用户名至少2个字符,最多10个字符",oncorrect:"该用户名可以注册"}).InputValidator({min:2,onerror:"你输入的用户名非法,请确认"}).RegexValidator({regexp:"username",datatype:"enum",onerror:"用户名格式不正确"})
	    .AjaxValidator({
	    type : "get",
		url : "${pageContext.request.contextPath}/userLogin/getValidForRegistUsername.do",
		datatype : "json",
		success : function(data){	
            if( data == "0" )
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#submitRegist"),
		error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
		onerror : "该用户名不可用，请更换用户名",
		onwait : "正在对用户名进行合法性校验，请稍候..."
	}).DefaultPassed();

	$("#useremail").formValidator({onshow:"请输入邮箱",onfocus:"邮箱至少6个字符,最多100个字符",oncorrect:"恭喜你,你输对了",defaultvalue:"@"}).InputValidator({min:6,max:100,onerror:"你输入的邮箱长度非法,请确认"}).RegexValidator({regexp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onerror:"你输入的邮箱格式不正确"});
	$("#userpwd").formValidator({onshow:"请输入密码",onfocus:"密码不能为空",oncorrect:"密码合法"}).InputValidator({min:1,onerror:"密码不能为空,请确认"});
	$("#name").formValidator({onshow:"请输入姓名",onfocus:"姓名不能为空",oncorrect:"姓名正确"}).InputValidator({min:1,onerror:"姓名不能为空,请确认"});
	$("#usercompany").formValidator({onshow:"请选择你的公司",onfocus:"公司必须选择",oncorrect:"谢谢你的配合"}).InputValidator({min:1,onerror: "你是不是忘记选择公司了!"}).CompareValidator({desID:"usercompany1",operateor:"=",onerror:"请选择公司"});
})
/* function submitRegistbutton(){
	alert(11);
	$("#submitRegist").submit( function () {
		 
		  return true;
	} );
} */
function getIfWaibao(){
	if($("#usercompany").val()=="tydic"){
		$("#departmentDiv").show();
	}else{
		$("#departmentDiv").hide();
	}
}

</script>
  </head>
  
  <body>
	<h1>综合产品中心项目日报管理系统<sup>tydic</sup></h1>
<div class="login" style="margin-top:50px;">
	<div class="header">
		<div class="switch" id="switch"><a class="switch_btn_focus" id="switch_qlogin" href="javascript:void(0);" tabindex="7">快速登录</a> <a class="switch_btn" id="switch_login" href="javascript:void(0);" tabindex="8">快速注册</a>
			<div class="switch_bottom" id="switch_bottom" style="position: absolute; width: 64px; left: 0px;"></div>
		</div>
	</div>
	<div class="web_qr_login" id="web_qr_login" style="display: block; height: 235px;"> 
		
		<!--登录-->
		<div class="web_login" id="web_login">
			<div class="login-box">
				<div class="login_form">
					<form action="${pageContext.request.contextPath}/userLogin/loginuser.do" name="loginform" accept-charset="utf-8" id="login_form" class="loginForm" method="post">
						<input type="hidden" name="did" value="0"/>
						<input type="hidden" name="to" value="log"/>
						<div class="uinArea" id="uinArea">
							<label class="input-tips" for="u">帐号：</label>
							<div class="inputOuter" id="uArea">
								<input type="text" id="username" name="username" class="inputstyle"/>
							</div>
						</div>
						<div class="pwdArea" id="pwdArea">
							<label class="input-tips" for="p">密码：</label>
							<div class="inputOuter" id="pArea">
								<input type="password" id="password" name="password" class="inputstyle"/>
							</div>
						</div>
						<div style="padding-left:50px;margin-top:20px;">
							<input type="submit" value="登 录" style="width:150px;" class="button_blue"/>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!--登录end--> 
	</div>
	
	<!--注册-->
	<div class="qlogin" id="qlogin" style="display: none; ">
		<div class="web_login">
			<form name="regUserForm" id="regUserForm" accept-charset="utf-8"  action="${pageContext.request.contextPath}/userLogin/registUser.do" method="post" onsubmit="return jQuery.formValidator.PageIsValid('1')">
				<input type="hidden" name="to" value="reg"/>
				<input type="hidden" name="did" value="0"/>
				<ul class="reg_form" id="reg-ul">
					<div id="userCue" class="cue">快速注册请注意格式</div>
					<li>
						<label for="user"  class="input-tips2">用户名：</label>
						<div class="inputOuter2">
							<input type="text" id="registusername" name="registusername"  class="inputstyle2"/>
							<div id="registusernameTip" style="width:180px"></div>
						</div>
						
					</li>
					<li>
						<label for="passwd" class="input-tips2">密码：</label>
						<div class="inputOuter2">
							<input type="password" id="userpwd"  name="userpwd" class="inputstyle2"/>
							<div id="userpwdTip" style="width:180px"></div>
						</div>
					</li>
					<li>
						<label for="passwd" class="input-tips2">用户姓名：</label>
						<div class="inputOuter2">
							<input type="text" id="name"  name="name"  class="inputstyle2"/>
							<div id="nameTip" style="width:180px"></div>
						</div>
					</li>
					<li>
						<label for="passwd2" class="input-tips2">邮箱：</label>
						<div class="inputOuter2">
							<input type="text" id="useremail" name="useremail" class="inputstyle2" />
							<div id="useremailTip" style="width:180px"></div>
						</div>
					</li>
					<li>
						<label for="qq" class="input-tips2">所属公司：</label>
						<div class="inputOuter2" >
							<select  class="inputstyle2" onchange="getIfWaibao();" id="usercompany" name="usercompany">
								<option>请选择...</option>
								<option>tydic</option>
								<option>其他</option>
							</select>
							<input type="hidden" id="usercompany1" name="usercompany1" value="请选择..." />
							
							<div id="usercompanyTip" style="width:180px"></div>
						</div>
						
					</li>
					<div id="departmentDiv" style="display: none">
						<li>
							<label for="qq" class="input-tips2">部门：</label>
							<div class="inputOuter2">
								<select  class="inputstyle2" id="userdepartment" name="userdepartment">
									<option>请选择...</option>
									<option>综合产品中心 </option>
								</select>
							</div>
						</li>
						<li>
							<label for="qq" class="input-tips2">工号：</label>
							<div class="inputOuter2">
								<input type="text" id="userworkid" name="userworkid" class="inputstyle2"/>
							</div>
						</li>
					</div>
					<div>
					<li>
						<div class="inputArea">
							<div style="padding-left:80px;margin-top:20px;">
								<input type="submit" value="注  册" style="width:150px;" id="submitRegist" class="button_blue"/>
							</div>
						</div>
					</li>
					<div class="cl"></div>
				</ul>
			</form>
		</div>
	</div>
	<!--注册end--> 
</div>
<div class="jianyi">*推荐使用ie8或以上版本ie浏览器或Chrome内核浏览器访问本站</div>
	
  </body>
</html>
